package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.MgcConfigDao;
import com.entity.MgcConfig;
import com.entity.ZhengshuxinxiEntity;
import com.entity.view.MgcConfigView;
import com.entity.view.ZhengshuxinxiView;
import com.entity.vo.MgcConfigVo;
import com.entity.vo.ZhengshuxinxiVO;
import com.service.MgcConfigService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 *
 */
@Service
public class MgcConfigServiceImpl extends ServiceImpl<MgcConfigDao, MgcConfig> implements MgcConfigService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<MgcConfig> page = this.selectPage(
                new Query<MgcConfig>(params).getPage(),
                new EntityWrapper<MgcConfig>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<MgcConfig> wrapper) {
        Page<MgcConfigView> page = new Query<MgcConfigView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page, wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<MgcConfigVo> selectListVO(Wrapper<MgcConfig> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public MgcConfigVo selectVO(Wrapper<MgcConfig> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<MgcConfigView> selectListView(Wrapper<MgcConfig> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public MgcConfigView selectView(Wrapper<MgcConfig> wrapper) {
        return baseMapper.selectView(wrapper);
    }


}
